package com.jrx.anytxn.customer.constant;

import org.springframework.stereotype.Component;

/**
 * 客户信息有关的信息常量
 *
 * @author liy
 * @version V1.0
 * @date 2019/7/22
 **/
@Component
public final class CustomerConstant {

    private CustomerConstant() {
    }

    //默认机构号
    public static final String DEFAULT_ORG_ID = "0001";

    //初始版本号
    public static final Integer INIT_RECORD_VERSION_NUMBER = 1;

    //证件结束时间
    public static final String ID_CARD_TYPE = "长期";
    /*
     * 客户额度状态
     */
    //正常
    public static final String STATUS_NORMAL = "1";
    //失效
    public static final String STATUS_FAILURE = "0";
    //冻结
    public static final String STATUS_FREEZE = "2";
    //未激活
    public static final String STATUS_NOT_ACTIVE = "3";
    // 注销
    public static final String STATUS_CANCEL = "4";


    /*
     * 渠道类型
     */
    //是自营渠道
    public static final String PRIVATE_CHANNEL_YES = "1";
    //不是自营渠道
    public static final String PRIVATE_CHANNEL_NO = "0";

    /*
     * 是否需要维护ECIF信息
     */
    //新增更新
    public static final String ECIF_UPDATE_ADDANDUPDATE = "2";
    //新增
    public static final String ECIF_UPDATE_ADD = "1";
    //否
    public static final String ECIF_UPDATE_NO = "0";

    /*
     * 客户类型
     */
    //自营客户
    public static final String CUSTOMER_TYPE_SELF = "0";
    //合作方客户
    public static final String CUSTOMER_TYPE_PARTNERSHIP = "1";
    //兼有类型
    public static final String CUSTOMER_TYPE_BOTH = "2";

    //客户查询类型-证件号
    public static final Integer QUERY_TYPE_ID_NUMBER = 0;
    //客户查询类型-手机号
    public static final Integer QUERY_TYPE_MOBILE = 1;

    /*
     * 客户数据库状态
     */
    //失效
    public static final String CREDIT_LIMIT_STATUS_0 = "0";
    //正常
    public static final String CREDIT_LIMIT_STATUS_1 = "1";
    //冻结
    public static final String CREDIT_LIMIT_STATUS_2 = "2";
    //注销
    public static final String CREDIT_LIMIT_STATUS_4 = "4";

    /*
     *请求的状态
     */
    //冻结
    public static final String CREDIT_OPERATETYPE_F = "F";
    //解冻
    public static final String CREDIT_OPERATETYPE_R = "R";
    //注销
    public static final String CREDIT_OPERATETYPE_C = "C";

    //使用方式_循环
    public static final String USER_MODEL_0 = "0";
    //使用方式_非循环
    public static final String USER_MODEL_1 = "1";
    //使用方式_一次性
    public static final String USER_MODEL_2 = "2";
    //检核标识_检查
    public static final String AUTH_CHECK_1 = "1";

    public static final String CUSTOMER_TYPE_CREDITFREEZE = "creditFreeze";

    public static final String CUSTOMER_TYPE_CREDITADJUST = "creditAdjust";

    /*
     *客户额度表的额度种类
     */
    //信用额度
    public static final String CUSTOMER_LIMIT_TYPE_0 = "0";
    //抵押额度
    public static final String CUSTOMER_LIMIT_TYPE_1 = "1";
    //担保额度
    public static final String CUSTOMER_LIMIT_TYPE_2 = "2";
    // 兜底额度
    public static final String CUSTOMER_LIMIT_TYPE_3 = "3";
    //其他
    public static final String CUSTOMER_LIMIT_TYPE_4 = "4";

    /**
     * 网关接口成功返回
     */
    public static final int GATEWAY_SUC = 1000;

    //新增ECIF
    public static final String GATEWAY_REGIST_TYPE_01 = "01";
    //修改ECIF
    public static final String GATEWAY_REGIST_TYPE_02 = "02";

    //根据证件号码查询
    public static final String GATEWAY_QUERY_TYPE_01 = "01";
    //根据ECIF号查询
    public static final String GATEWAY_QUERY_TYPE_02 = "02";

    //业务处理结果
    public static final String GATEWAY_BUS_CODE_SUC = "0000";

    public static final String GATEWAY_SERVICE_ID = "txn";

    public static final Long REDIS_LOCK_WAITE_TIME = 60L; //锁等待时间

    public static final Long REDIS_LOCK_LESS_TIME = 60L; //锁过期时间

    public static final String LOCK_CUST= "TXN_CUST_CREATION_TENANT_%s_USER_%s_CHANNEL_%s";

    public static final String LOCK_BANK= "TXN_BANK_TENANT_%s_USER_%s_CHANNEL_%s";

    public static final String LOAN_REDIS_LOCK = "TXN_LOAN_TENANT_%s_CUST_%s"; //放款、还款分配redis锁 根据客户
    public static final Long LOAN_REDIS_LOCK_WAITE_TIME = 60L; //还款锁等待时间
    public static final Long LOAN_REDIS_LOCK_LESS_TIME = 180L; //锁过期时间


    public static final String MQ_BATCH_LIMIT_ADJUST_TOPIC = "ANYTXN_MQ_BATCH_LIMIT_ADJUST_TOPIC";//批量调额信息TOPIC

    public static final String MQ_BATCH_LIMIT_ADJUST_GROUP = "ANYTXN_MQ_CONSUMER_BATCH_LIMIT_ADJUST_GROUP";//批量调额信息TOPIC

    public static final String ADDRESS_TYPE_0 = "0";//户籍地址
    public static final String ADDRESS_TYPE_1 = "1";//家庭地址
    public static final String ADDRESS_TYPE_2 = "2";//通讯地址
    public static final String ADDRESS_TYPE_3 = "3";//单位地址
    public static final String ADDRESS_TYPE_4 = "4";//学校地址

    public static final String SUCCESS = "S";//
    public static final String FAIL = "F";//

    public static final String DATASOURCE_1 = "1";//批量调额
    public static final String DATASOURCE_2 = "2";//联机调额

    public static final String CODE_PROVINCE_TYPE = "PROVINCE";//省
    public static final String CODE_CITY_TYPE = "CITY";//市
    public static final String CODE_ECIF_PROVINCE_TYPE = "ECIF_PROVINCE";//省

    //各种标志值 （是与否）
    public static final String YES_FLAG = "1";// 标志 是
    public static final String NO_FLAG = "0";// 标志 否

    /**
     * 合作方授信MQ队列
     */
    public static final String MQ_INVESTOR_CREDIT_TOPIC = "ANYTXN_MQ_INVESTOR_CREDIT_TOPIC";
    public static final String MQ_INVESTOR_CREDIT_TX_GROUP = "ANYTXN_MQ_INVESTOR_CREDIT_TX_GROUP";

    //权益状态
    public static final String RIGHTS_STATUS_0 = "0";//未使用
    public static final String RIGHTS_STATUS_1 = "1";//已使用

    //权益类型
    public static final String RIGHTS_TYPE_01 = "01";//按天免息
    public static final String RIGHTS_TYPE_02 = "02";//按折扣免息

    //折扣计算方式
    public static final String DISCOUNT_TYPE_1 = "1";//按期

    public static final String CM_CUSTOMER_RIGHT_INFO = "CmCustomerRightInfo";
    public static final String CM_CUSTOMER_LABEl_ID = "CmCustomerLabel";
    public static final String TL_CUSTOMER_LABEl_LOG_ID = "TlCustomerLabelLog";


    public static final String TL_COUPON_SUMMARY_INFO = "TlCouponSummary";
    public static final String TL_COUPON_DETAIL_INFO = "TlCouponDetail";
    public static final String TL_COUPON_USE_LOG = "TlCouponUseLog";

    //调额类型
    public static final String ADJUST_TYPE_0 = "0"; // 0 调额
    public static final String ADJUST_TYPE_1 = "1"; // 1 冻结
    public static final String ADJUST_TYPE_2 = "2"; // 2 解冻
    public static final String ADJUST_TYPE_3 = "3"; // 3 授信
    public static final String ADJUST_TYPE_4 = "4"; // 4 注销
    //额度计算方式
    public static final String OC_FLAG_0 = "0";// 0 输入
    public static final String OC_FLAG_1 = "1";// 1 求和
    public static final String OC_FLAG_2 = "2";// 2 最大值
    public static final String OC_FLAG_3 = "3";// 3 最小值

    //营销记录所属阶段
    public static final String MARKET_STEP_1 = "1";// 1 注册
    public static final String MARKET_STEP_2 = "2";// 2 授信
    public static final String MARKET_STEP_3 = "3";// 3 借款

    //营销记录发送状态
    public static final String MARKET_SUM_STATUS_S = "S";// S 成功
    public static final String MARKET_SUM_STATUS_F = "F";// F 失败
    public static final String MARKET_SUM_STATUS_T = "T";// T 待发送
    public static final String MARKET_SUM_STATUS_O = "O";// O 未知待查证

    public static final String CONTACT_TYPE_00 = "00";
    public static final String CONTACT_TYPE_01 = "01";
    public static final String CONTACT_TYPE_02 = "02";
    public static final String CONTACT_TYPE_03 = "03";
    public static final String CONTACT_TYPE_04 = "04";
    public static final String CONTACT_TYPE_05 = "05";
    public static final String CONTACT_TYPE_06 = "06";
    public static final String CONTACT_TYPE_07 = "07";
    public static final String CONTACT_TYPE_08 = "08";
    public static final String CONTACT_TYPE_09 = "09";

    public static final String MQ_ID_INVALID_TOPIC = "ANYTXN_ID_INVALID_TOPIC";
    public static final String MQ_ID_INVALID_GROUP = "ANYTXN_ID_INVALID_GROUP";

    // 延迟短信模板id
    public static final String DELAY_SMS_TEMPLATE_ID = "INVALID009";
    public static final String TL_DELAY_SMS_ID = "TlDelaySms";
    public static final String DELAY_SYS_TYPE = "idInvalid";
    public static final String DELAY_SMS_DEAL_STATUS = "D";
    public static final String DELAY_SMS_UPDATE_BY = "system";

    /**
     * 权益下单平台场景id
     */
    public static final String SCENE_ID = "847871884477636608";

    /**
     * 证件即将失效提醒
     */
    public static final String SMS_TYPE_ID_WILL_INVALID = "idWillInvalid";
    /**
     * 证件失效提醒
     */
    public static final String SMS_TYPE_ID_INVALID = "idInvalid";


    //用到的所有 Y N 常量
    public static final String FLAG_Y = "Y";//常量Y
    public static final String FLAG_N = "N";//常量N

    /*
     *信用就医冻结解冻 请求的状态
     */
    //冻结
    public static final String OPERATE_TYPE_F = "F";
    //解冻
    public static final String OPERATE_TYPE_R = "R";
}
